<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
		<meta name="viewport" content="width=device-width, initial-scale=1"> 
		<title>页面加载特效（Page Loading Effects） | Demo 2</title>
		<meta name="description" content="页面加载特效（Page Loading Effects）: " />
		
		<meta name="author" content="Codrops" />
		<link rel="shortcut icon" href="../favicon.ico">
		<link rel="stylesheet" type="text/css" href="css/normalize.css" />
		<link rel="stylesheet" type="text/css" href="css/demo.css" />
		<link rel="stylesheet" type="text/css" href="css/component.css" />
		<script src="js/snap.svg-min.js"></script>
		<!--[if IE]>
  		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
		<link rel="stylesheet" href="http://dreamsky.github.io/main/blog/common/init.css">
		<script src="http://dreamsky.github.io/main/blog/common/jquery.min.js"></script>
		<script src="http://dreamsky.github.io/main/blog/common/init.js"></script>
	</head>
	<body>
		<div id="pagewrap" class="pagewrap">
			<div class="container show" id="page-1">
				<!-- Top Navigation -->
				<header class="codrops-header">
					<h1 style="margin-top:100px">页面加载特效（Page Loading Effects） <span></span></h1>
				</header>
				<section class="columns clearfix">
					<div class="column">
						<nav class="codrops-demos">
							<a href="index.html">效果一</a>
							<a class="current-demo" href="index2.html">效果二</a>
							<a href="index3.html">效果三</a>
							<a href="index4.html">效果四</a>
							<a href="index5.html">效果五</a>
							<a href="index6.html">效果六</a>
							<a href="index7.html">效果七</a>
							<a href="index8.html">效果八</a>
							<a href="index9.html">效果九</a>
							<a href="index10.html">效果十</a>
							<a href="index11.html">效果十一</a>
							<a href="index12.html">效果十二</a>
							<a href="index13.html">效果十三</a>
						</nav>
					</div>
					<div class="column">
						<p></p>
						<p><a class="pageload-link" href="#page-2">点击预览效果</a></p>
					</div>
				</section>
				<div class="footer-banner" style="width:728px; margin:30px auto"></div>
			</div><!-- /container -->

			<!-- The new page dummy; this would be dynamically loaded content -->
			<div class="container" id="page-2">
				<section>
					<h2>这是一个示例页面.</h2>
					<p><a class="pageload-link" href="#page-1">返回</a></p>
				</section>
			</div><!-- /container -->

			<div id="loader" class="pageload-overlay" data-opening="M 40 -21.875 C 11.356078 -21.875 -11.875 1.3560784 -11.875 30 C -11.875 58.643922 11.356078 81.875 40 81.875 C 68.643922 81.875 91.875 58.643922 91.875 30 C 91.875 1.3560784 68.643922 -21.875 40 -21.875 Z">
				<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 80 60" preserveAspectRatio="xMidYMid slice">
					<path d="M40,30 c 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 Z"/>
				</svg>
			</div><!-- /pageload-overlay -->
			
		</div><!-- /pagewrap -->
		<script src="js/classie.js"></script>
		<script src="js/svgLoader.js"></script>
		<script>
			(function() {
				var pageWrap = document.getElementById( 'pagewrap' ),
					pages = [].slice.call( pageWrap.querySelectorAll( 'div.container' ) ),
					currentPage = 0,
					triggerLoading = [].slice.call( pageWrap.querySelectorAll( 'a.pageload-link' ) ),
					loader = new SVGLoader( document.getElementById( 'loader' ), { speedIn : 300, easingIn : mina.easeinout } );

				function init() {
					triggerLoading.forEach( function( trigger ) {
						trigger.addEventListener( 'click', function( ev ) {
							ev.preventDefault();
							loader.show();
							// after some time hide loader
							setTimeout( function() {
								loader.hide();

								classie.removeClass( pages[ currentPage ], 'show' );
								// update..
								currentPage = currentPage ? 0 : 1;
								classie.addClass( pages[ currentPage ], 'show' );

							}, 2000 );
						} );
					} );	
				}

				init();
			})();
		</script>
	</body>
</html>